@layout('layouts/app')

@section('body')
  <div class="editor-page">
      <div class="container page">
          <div class="row">

              <div class="col-md-10 offset-md-1 col-xs-12">
                  <form action="{{ route('articles.update', article, { qs: { _method: 'PATCH' } }) }}" method="POST">
                      <fieldset>
                          <fieldset class="form-group">
                              <input value="{{ article.title }}" type="text" name="title" id="title" aria-label="article title" class="form-control form-control-lg" placeholder="Article Title">
                          </fieldset>
                          <fieldset class="form-group">
                              <input value="{{ article.description }}" type="text" name="description" id="description" aria-label="What's this article about?" class="form-control" placeholder="What's this article about?">
                          </fieldset>
                          <fieldset class="form-group">
                              <textarea class="form-control" rows="8" id="body" name="body" aria-label="article content"
                                        placeholder="Write your article (in markdown)">{{ article.body }}</textarea>
                          </fieldset>
                          <fieldset class="form-group">
                              <input value="{{ article.tags.map(tag => tag.value).join(', ') }}" type="text" id="tags" name="tags" aria-label="enter tags (comma separated)" class="form-control" placeholder="Enter tags">
                              <div class="tag-list"></div>
                          </fieldset>
                          <button class="btn btn-lg pull-xs-right btn-primary" type="submit">
                              Update Article
                          </button>
                      </fieldset>
                  </form>
              </div>

          </div>
      </div>
  </div>
@end
